package top.xiangqifu.springboot2_auth.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import top.xiangqifu.springboot2_auth.validate.RegInfo;
import top.xiangqifu.springboot2_auth.validate.UserValidate;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(value = "用户信息" , description = "用户信息应答对象")
public class TbAuthUser implements Serializable {
  private static final long serialVersionUID = 1L;
  @ApiModelProperty(value = "用户编号，主键",example = "1")
  @ApiParam(hidden = true)
  private Integer userId;
  @ApiModelProperty(value = "账号",example = "xqf666")
  @ApiParam(hidden = true)
  @NotBlank(message = "用户账号必须填写必须填写",groups = {UserValidate.login.class,UserValidate.reg.class})
  @Pattern(regexp = RegInfo.DEPT_NAME,message = "用户账号必须是4-16位的非空白字符",groups = {UserValidate.login.class,UserValidate.reg.class})
  private String username;
  @ApiModelProperty(value = "密码",example = "xqf111")
  @ApiParam(hidden = true)
  @NotBlank(message = "用户密码必须填写必须填写",groups = {UserValidate.login.class,UserValidate.reg.class})
  @Pattern(regexp = RegInfo.DEPT_NAME,message = "用户密码必须是4-16位的非空白字符",groups = {UserValidate.login.class,UserValidate.reg.class})
  private String password;
  @ApiModelProperty(value = "随机密码加密盐",example = "")
  @ApiParam(hidden = true)
  private String salt;
  @ApiModelProperty(value = "账号是否启用",example = "")
  @ApiParam(hidden = true)
  private String enable;
  @ApiModelProperty(value = "角色编号",example = "")
  @ApiParam(hidden = true)
  private Integer roleId;
  @ApiModelProperty(value = "用户注册时间",example = "")
  @ApiParam(hidden = true)
  private Date lastupdate;
}
